home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / EditPolygonsMenu.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  23.6 KB  |  833 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  Aug 28, 1998
  22. //
  23. //  Author:         bkwok
  24. //
  25. //  Description:
  26. //      This implements the "Edit Polygons" menu on the modeling menubar.
  27. //
  28.  
  29. global proc string editPolygonsMenuItemToShelf (string $item)
  30. {
  31.     return $item;
  32. }
  33.  
  34. // Description: Determines the poly prelight procedure associated with the
  35. //                current renderer and executes it
  36. // Returns:        None
  37. //
  38. global proc callRendererSpecificPolyPrelight(int $arg)
  39. {
  40.     $command = eval("renderer -query -polyPrelightProcedure (currentRenderer())");
  41.     if ($command != "")
  42.     {
  43.         eval $command $arg;
  44.     }
  45.     else
  46.     {
  47.         string $currentRendererName = currentRenderer(); 
  48.         string $renUIName = `renderer -query -rendererUIName $currentRendererName`; 
  49.         error     -showLineNumber    true
  50.                 ("Current Renderer " + $renUIName
  51.                 + " does not support polygon prelight");
  52.     }
  53.  
  54. }
  55.  
  56.  
  57. proc PolyClipboardMenu( string $parent )
  58. //
  59. // Description:
  60. //        Polygon clipboard action menu
  61. //
  62. {
  63.     setParent -menu $parent;
  64.  
  65.     menuItem
  66.         -label "Copy" 
  67.         -annotation (getRunTimeCommandAnnotation("PolygonCopy"))
  68.         -command "PolygonCopy"
  69.         -dragMenuCommand "performPolyCopyPaste 2 1"
  70.         -dragDoubleClickCommand "PolygonCopyOptions"
  71.         ;
  72.     
  73.     menuItem -optionBox true 
  74.         -imageOverlayLabel "CPOB"
  75.         -annotation (getRunTimeCommandAnnotation("PolygonCopyOptions"))
  76.         -command "PolygonCopyOptions"
  77.         ;            
  78.  
  79.     menuItem -label "Paste" 
  80.         -annotation (getRunTimeCommandAnnotation("PolygonPaste"))
  81.         -command "PolygonPaste"
  82.         -dragMenuCommand "performPolyCopyPaste 2 2"
  83.         -dragDoubleClickCommand "PolygonPasteOptions"
  84.         ;
  85.     
  86.     menuItem -optionBox true 
  87.         -annotation (getRunTimeCommandAnnotation("PolygonPasteOptions"))
  88.         -command "PolygonPasteOptions"
  89.         ;            
  90.  
  91.     menuItem -label "Clear Clipboard" 
  92.         -annotation (getRunTimeCommandAnnotation("PolygonClearClipboard"))
  93.         -command "PolygonClearClipboard"
  94.         -dragMenuCommand "performPolyCopyPaste 2 3"
  95.         -dragDoubleClickCommand "PolygonClearClipboardOptions"
  96.         ;
  97.     
  98.     menuItem -optionBox true 
  99.         -imageOverlayLabel "CLOB"
  100.         -annotation (getRunTimeCommandAnnotation("PolygonClearClipboardOptions"))
  101.         -command "PolygonClearClipboardOptions"
  102.         ;            
  103. }
  104.  
  105. proc PolyColorsMenu( string $parent )
  106. //
  107. // Description:
  108. //        Polygon color editing menu
  109. //
  110. {
  111.     setParent -menu $parent;
  112.  
  113.     menuItem -checkBox false
  114.         -label "Convert Display" 
  115.         -annotation "Convert Display: Switch to Show Colors in Shaded mode when appropriate"
  116.         -enableCommandRepeat false
  117.         -command "toggleAutoShowColorPerVertex" 
  118.         toggleAutoShowColorPerVertexItem;
  119.  
  120.     menuItem -divider true;
  121.  
  122.     menuItem
  123.         -label "Apply Color"
  124.         -annotation (getRunTimeCommandAnnotation("PolygonApplyColor"))
  125.         -image "polyApplyColor.xpm"
  126.         -command "PolygonApplyColor"
  127.         -dragMenuCommand "performApplyColor 2"
  128.         -dragDoubleClickCommand "PolygonApplyColorOptions"
  129.         ;
  130.     menuItem -optionBox true 
  131.         -annotation (getRunTimeCommandAnnotation("PolygonApplyColorOptions"))
  132.         -image "polyApplyColor.xpm"
  133.         -command "PolygonApplyColorOptions"
  134.         ;
  135.  
  136.     menuItem
  137.         -label "Prelight (Maya Software)"
  138.         -annotation ("Prelight polygon using the Maya software renderer")
  139.         -command ("performPrelight " + 0)
  140.         -dragMenuCommand ("performPrelight " + 2)
  141.         -dragDoubleClickCommand ("performPrelight " + 1)
  142.         ;
  143.     menuItem -optionBox true 
  144.         -annotation ("Option box for prelighting polygon using the Maya software renderer")
  145.         -command ("performPrelight " + 1)
  146.         ;
  147.  
  148.     menuItem
  149.         -label "Prelight (mental ray)"
  150.         -annotation ("Prelight polygon using mental ray")
  151.         -command ("mrBakeToVertices " + 0)
  152.         -dragMenuCommand ("mrBakeToVertices " + 2)
  153.         -dragDoubleClickCommand ("mrBakeToVertices " + 1)
  154.                 mentalPrelightItem
  155.         ;
  156.     menuItem -optionBox true 
  157.         -annotation ("Option box for prelighting polygon using mental ray")
  158.         -command ("mrBakeToVertices " + 1)
  159.                 mentalPrelightOptionsItem
  160.         ;
  161.  
  162.     menuItem
  163.         -label "Set Vertex Color Key"
  164.         -annotation "Set Vertex Color Key: Set a keyframe for colors on selected polygon components"
  165.         -command "setPolyColorKeyframe"
  166.         ;
  167.  
  168.     menuItem
  169.         -label "Paint Vertex Color Tool"
  170.         -annotation (getRunTimeCommandAnnotation("PaintVertexColorTool"))
  171.         -image "paintVertexColour.xpm"
  172.         -command "PaintVertexColorTool"
  173.         -dragDoubleClickCommand "PaintVertexColorToolOptions"
  174.         ;
  175.  
  176.     menuItem -optionBox true
  177.         -annotation (getRunTimeCommandAnnotation("PaintVertexColorToolOptions"))
  178.         -image "paintVertexColour.xpm"
  179.         -command "PaintVertexColorToolOptions"
  180.         ;
  181.  
  182.     menuItem -edit -checkBox `optionVar -query polyAutoShowColorPerVertex`
  183.         toggleAutoShowColorPerVertexItem;
  184. }
  185.  
  186. global proc refreshPolyColorsMenu( string $parent )
  187. //
  188. // Description:
  189. //        Refresh Polygon color editing menu
  190. //
  191. {
  192.     int $mentalIsLoaded = 0;
  193.  
  194.     string $renderer;
  195.     for ($renderer in `renderer -query -namesOfAvailableRenderers`) 
  196.     {
  197.         if( $renderer == "mentalRay" ) 
  198.         {
  199.             $mentalIsLoaded = 1;
  200.             break;
  201.         }
  202.     }
  203.  
  204.     menuItem -edit -enable $mentalIsLoaded mentalPrelightItem;
  205.     menuItem -edit -enable $mentalIsLoaded mentalPrelightOptionsItem;
  206. }
  207.  
  208. //////////////////////////////////////////////////////////////////////
  209.  
  210. proc PolySelectMenu( string $parent )
  211. //
  212. // Description:
  213. //        Polygon selection options menu
  214. //
  215. {
  216.     setParent -menu $parent;
  217.  
  218.     menuItem
  219.         -label "Grow Selection Region"
  220.         -annotation (getRunTimeCommandAnnotation("GrowPolygonSelectionRegion"))
  221.         -command "GrowPolygonSelectionRegion"
  222.         -dragMenuCommand "editPolygonsMenuItemToShelf \"polySelectConstraint -pp 1\""
  223.         ;
  224.  
  225.     menuItem
  226.         -label "Shrink Selection Region"
  227.         -annotation (getRunTimeCommandAnnotation("ShrinkPolygonSelectionRegion"))
  228.         -command "ShrinkPolygonSelectionRegion"
  229.         -dragMenuCommand "editPolygonsMenuItemToShelf \"polySelectConstraint -pp 2\""
  230.         ;
  231.  
  232.     menuItem
  233.         -label "Select Selection Boundary"
  234.         -annotation (getRunTimeCommandAnnotation("SelectPolygonSelectionBoundary"))
  235.         -command "SelectPolygonSelectionBoundary"
  236.         -dragMenuCommand "editPolygonsMenuItemToShelf \"polySelectConstraint -pp 3\""
  237.         ;
  238.  
  239.     menuItem
  240.         -label "Select Contiguous Edges"
  241.         -annotation (getRunTimeCommandAnnotation("SelectContiguousEdges"))
  242.         -image "polyLoopEdge.xpm"
  243.         -command "SelectContiguousEdges"
  244.         ;
  245.  
  246.     menuItem -optionBox true
  247.         -annotation (getRunTimeCommandAnnotation("SelectContiguousEdgesOptions"))
  248.         -image "polyLoopEdge.xpm"
  249.         -command "SelectContiguousEdgesOptions"
  250.         ;
  251.  
  252.     menuItem -divider true;
  253.  
  254.     menuItem
  255.         -label "Convert Selection to Faces"
  256.         -annotation (getRunTimeCommandAnnotation("ConvertSelectionToFaces"))
  257.         -image "polyConvertToFace.xpm"
  258.         -command "ConvertSelectionToFaces"
  259.         ;
  260.  
  261.     menuItem
  262.         -label "Convert Selection to Edges"
  263.         -annotation (getRunTimeCommandAnnotation("ConvertSelectionToEdges"))
  264.         -image "polyConvertToEdge.xpm"
  265.         -command "ConvertSelectionToEdges"
  266.         ;
  267.  
  268.     menuItem
  269.         -label "Convert Selection to Vertices"
  270.         -annotation (getRunTimeCommandAnnotation("ConvertSelectionToVertices"))
  271.         -image "polyConvertToVertices.xpm"
  272.         -command "ConvertSelectionToVertices"
  273.         ;
  274.  
  275.     menuItem
  276.         -label "Convert Selection to UVs"
  277.         -annotation (getRunTimeCommandAnnotation("ConvertSelectionToUVs"))
  278.         -image "polyConvertToUVs.xpm"
  279.         -command "ConvertSelectionToUVs"
  280.         ;
  281.  
  282.     menuItem
  283.         -label "Convert Selection to Vertex Faces"
  284.         -annotation (getRunTimeCommandAnnotation("ConvertSelectionToVertexFaces"))
  285.         -command "ConvertSelectionToVertexFaces"
  286.         ;
  287.  
  288.     menuItem -divider true;
  289.  
  290.     menuItem -label "Selection Constraints..."
  291.         -annotation (getRunTimeCommandAnnotation("PolygonSelectionConstraints"))
  292.         -command "PolygonSelectionConstraints"
  293.         ;
  294.     
  295. }
  296.  
  297. //////////////////////////////////////////////////////////////////////
  298.  
  299. proc PolyNormalsMenu( string $parent )
  300. //
  301. // Description:
  302. //        Polygon normal editing menu
  303. //
  304. {
  305.     setParent -menu $parent;
  306.  
  307.     menuItem
  308.         -label "Set Vertex Normal"
  309.         -annotation (getRunTimeCommandAnnotation("SetVertexNormal"))
  310.         -command "SetVertexNormal" 
  311.         -dragMenuCommand "performPolySetNormal 2"
  312.         -dragDoubleClickCommand "SetVertexNormalOptions"
  313.         ;
  314.  
  315.     menuItem -optionBox true 
  316.         -annotation (getRunTimeCommandAnnotation("SetVertexNormalOptions"))
  317.         -command "SetVertexNormalOptions"
  318.         ;
  319.  
  320.     menuItem
  321.         -label "Average Normals"
  322.         -annotation (getRunTimeCommandAnnotation("AveragePolygonNormals"))
  323.         -image "polyNormalAverage.xpm"
  324.         -command "AveragePolygonNormals"
  325.         -dragMenuCommand "performPolyAverageNormal 2"
  326.         -dragDoubleClickCommand "AveragePolygonNormalsOptions"
  327.         ;
  328.  
  329.     menuItem -optionBox true
  330.         -image "polyNormalAverage.xpm"
  331.         -annotation (getRunTimeCommandAnnotation("AveragePolygonNormalsOptions"))
  332.         -command "AveragePolygonNormalsOptions"
  333.         ;
  334.  
  335.     menuItem
  336.         -label "Set to Face"
  337.         -annotation (getRunTimeCommandAnnotation("SetToFaceNormals"))
  338.         -image "polyNormalSetToFace.xpm"
  339.         -command "SetToFaceNormals"
  340.         -dragMenuCommand "performPolySetToFaceNormal 2"
  341.         -dragDoubleClickCommand "SetToFaceNormalsOptions"
  342.         ;
  343.  
  344.     menuItem -optionBox true
  345.         -annotation (getRunTimeCommandAnnotation("SetToFaceNormalsOptions"))
  346.         -image "polyNormalSetToFace.xpm"
  347.         -command "SetToFaceNormalsOptions"
  348.         ;
  349.  
  350.     menuItem
  351.         -label "Reverse"
  352.         -annotation (getRunTimeCommandAnnotation("ReversePolygonNormals"))
  353.         -image "polyNormal.xpm" 
  354.         -command "ReversePolygonNormals"
  355.         -dragDoubleClickCommand "ReversePolygonNormalsOptions"
  356.         ;
  357.  
  358.     menuItem -optionBox true
  359.         -annotation (getRunTimeCommandAnnotation("ReversePolygonNormalsOptions"))
  360.         -image "polyNormal.xpm"
  361.         -command "ReversePolygonNormalsOptions"
  362.         ;
  363.  
  364.     menuItem
  365.         -label "Conform"
  366.         -annotation (getRunTimeCommandAnnotation("ConformPolygonNormals"))
  367.         -image "polyNormalsConform.xpm"
  368.         -command "ConformPolygonNormals"
  369.         ;
  370.  
  371.     menuItem
  372.         -label "Soften/Harden"
  373.         -annotation (getRunTimeCommandAnnotation("PolygonSoftenHarden"))
  374.         -image "polySoftEdge.xpm"
  375.         -command "PolygonSoftenHarden" 
  376.         -dragMenuCommand "performPolySoftEdge 2"
  377.         -dragDoubleClickCommand "PolygonSoftenHardenOptions"
  378.         ;
  379.  
  380.     menuItem -optionBox true
  381.         -annotation (getRunTimeCommandAnnotation("PolygonSoftenHardenOptions"))
  382.         -image "polySoftEdge.xpm" 
  383.         -command "PolygonSoftenHardenOptions"
  384.         ;
  385. }
  386.  
  387. //////////////////////////////////////////////////////////////////////
  388.  
  389.  
  390. global proc EditPolygonsMenu(string $parent)
  391. //
  392. // Description:
  393. //        Polygon edit menu
  394. //
  395. {
  396.     if (!`isTrue "PolygonsExists"`) return;
  397.  
  398.     setParent -menu $parent;
  399.     
  400.     if( `menu -query -numberOfItems $parent` != 0 ) {
  401.         // Just edit the label ...
  402.         string $cutFacesLabel, $cutFacesOptions, $cutFacesAnnotation;
  403.         if( !`optionVar -exists polyPlaneCutDirection` || 
  404.             (5 == `optionVar -q polyPlaneCutDirection` ) ) {
  405.             $cutFacesLabel = "Cut Faces Tool";
  406.             $cutFacesOptions = "Cut Faces Tool Options";
  407.             $cutFacesAnnotation = "Cut Faces Tool: Cut the faces using a plane";
  408.         } else {
  409.             $cutFacesLabel = "Cut Faces";
  410.             $cutFacesOptions = "Cut Faces Options";
  411.             $cutFacesAnnotation = "Cut Faces: Cut the faces using a plane";
  412.         }
  413.  
  414.         menuItem -edit
  415.             -label $cutFacesLabel
  416.             -annotation $cutFacesAnnotation
  417.             EditPolygonCutPolygonItem;
  418.  
  419.         menuItem -edit
  420.             -annotation $cutFacesOptions
  421.             EditPolygonCutPolygonOptionsItem;
  422.  
  423.         return;
  424.  
  425.     } else {
  426.  
  427.         // Texture
  428.         string $textItem=`menuItem -label "Texture"
  429.             -subMenu true -tearOff true
  430.             -allowOptionBoxes true polyTexturesItem`;
  431.         PolyTextureMenu $textItem 0 "ls -sl";
  432.         setParent -menu ..;
  433.         menuItem -divider true;
  434.  
  435.         //////////////////////////////////////////////////////////////////////
  436.         menuItem
  437.             -label "Subdivide"
  438.             -annotation (getRunTimeCommandAnnotation("SubdividePolygon"))
  439.             -image "polySubdFacet.xpm"
  440.             -command "SubdividePolygon"
  441.             -dragMenuCommand "performPolySubdivide \"\" 2" 
  442.             -dragDoubleClickCommand "SubdividePolygonOptions"
  443.             ;
  444.  
  445.         menuItem -optionBox true
  446.             -annotation (getRunTimeCommandAnnotation("SubdividePolygonOptions"))
  447.             -image "polySubdFacet.xpm" 
  448.             -command "SubdividePolygonOptions" 
  449.             ;    
  450.  
  451.         menuItem
  452.             -label "Split Polygon Tool"
  453.             -annotation (getRunTimeCommandAnnotation("SplitPolygonTool"))
  454.             -image "polySplitFacet.xpm"
  455.             -command "SplitPolygonTool"
  456.             -dragDoubleClickCommand "SplitPolygonToolOptions"
  457.             ;
  458.  
  459.         menuItem -optionBox true
  460.             -annotation (getRunTimeCommandAnnotation("SplitPolygonToolOptions"))
  461.             -image "polySplitFacet.xpm" 
  462.             -command "SplitPolygonToolOptions" 
  463.             ;
  464.  
  465.         //////////////////////////////////////////////////////////////////////        
  466.         menuItem -divider true;
  467.  
  468.         menuItem
  469.             -label "Extrude Face"
  470.             -annotation (getRunTimeCommandAnnotation("ExtrudeFace"))
  471.             -image "polyExtrudeFacet.xpm"
  472.             -command "ExtrudeFace"
  473.             -dragMenuCommand "performPolyChipOff 2 2" 
  474.             -dragDoubleClickCommand "ExtrudeFaceOptions"
  475.             ;
  476.  
  477.         menuItem -optionBox true
  478.             -annotation (getRunTimeCommandAnnotation("ExtrudeFaceOptions"))
  479.             -image "polyExtrudeFacet.xpm" 
  480.             -command "ExtrudeFaceOptions"
  481.             ;
  482.  
  483.         menuItem
  484.             -label "Extrude Edge"
  485.             -annotation (getRunTimeCommandAnnotation("ExtrudeEdge"))
  486.             -image "polyExtrudeEdge.xpm"
  487.             -command "ExtrudeEdge"
  488.             -dragMenuCommand "performPolyChipOff 2 4" 
  489.             -dragDoubleClickCommand "ExtrudeEdgeOptions"
  490.             ;
  491.  
  492.         menuItem -optionBox true
  493.             -annotation (getRunTimeCommandAnnotation("ExtrudeEdgeOptions"))
  494.             -image "polyExtrudeEdge.xpm" 
  495.             -command "ExtrudeEdgeOptions"
  496.             ;
  497.  
  498.         menuItem
  499.             -label "Extrude Vertex"
  500.             -annotation (getRunTimeCommandAnnotation("ExtrudeVertex"))
  501.             -image "polyExtrudeVertex.xpm"
  502.             -command "ExtrudeVertex"
  503.             -dragMenuCommand "performPolyExtrudeVertex 2" 
  504.             -dragDoubleClickCommand "ExtrudeVertexOptions"
  505.             ;
  506.  
  507.         menuItem -optionBox true
  508.             -annotation (getRunTimeCommandAnnotation("ExtrudeVertexOptions"))
  509.             -image "polyExtrudeVertex.xpm" 
  510.             -command "ExtrudeVertexOptions"
  511.             ;
  512.  
  513.         menuItem -divider true;
  514.  
  515.         //////////////////////////////////////////////////////////////////////        
  516.         menuItem
  517.             -label "Chamfer Vertex"
  518.             -annotation (getRunTimeCommandAnnotation("ChamferVertex"))
  519.             -image "polyChamfer.xpm"
  520.             -command "ChamferVertex" 
  521.             -dragMenuCommand "performPolyChamferVertex 2"
  522.             -dragDoubleClickCommand "ChamferVertexOptions"
  523.             ;
  524.  
  525.         menuItem -optionBox true
  526.             -annotation (getRunTimeCommandAnnotation("ChamferVertexOptions"))
  527.             -image "polyChamfer.xpm" 
  528.             -command "ChamferVertexOptions"
  529.             ;        
  530.         
  531.         menuItem
  532.             -label "Bevel"
  533.             -annotation (getRunTimeCommandAnnotation("BevelPolygon"))
  534.             -image "polyBevel.xpm"
  535.             -command "BevelPolygon" 
  536.             -dragMenuCommand "performPolyBevel 2"
  537.             -dragDoubleClickCommand "BevelPolygonOptions"
  538.             ;
  539.  
  540.         menuItem -optionBox true
  541.             -annotation (getRunTimeCommandAnnotation("BevelPolygonOptions"))
  542.             -image "polyBevel.xpm" 
  543.             -command "BevelPolygonOptions"
  544.             ;
  545.         
  546.         //////////////////////////////////////////////////////////////////////        
  547.         menuItem -divider true;
  548.  
  549.         string $cutFacesLabel, $cutFacesOptions, $cutFacesAnnotation;
  550.  
  551.         if( !`optionVar -exists polyPlaneCutDirection` || 
  552.             (5 == `optionVar -q polyPlaneCutDirection` ) ) {
  553.             $cutFacesLabel = "Cut Faces Tool";
  554.             $cutFacesOptions = "Cut Faces Tool Options";
  555.             $cutFacesAnnotation = "Cut Faces Tool: Cut the faces using a plane";
  556.         } else {
  557.             $cutFacesLabel = "Cut Faces";
  558.             $cutFacesOptions = "Cut Faces Options";
  559.             $cutFacesAnnotation = "Cut Faces: Cut the faces using a plane";
  560.         }
  561.  
  562.         menuItem
  563.             -label $cutFacesLabel
  564.             -annotation $cutFacesAnnotation
  565.             -image "polyCut.xpm" 
  566.             -command "CutPolygon" 
  567.             -dragDoubleClickCommand "CutPolygonOptions"
  568.             EditPolygonCutPolygonItem;
  569.  
  570.         menuItem -optionBox true
  571.             -annotation $cutFacesOptions
  572.             -image "polyCut.xpm" 
  573.             -command "CutPolygonOptions" 
  574.             EditPolygonCutPolygonOptionsItem;
  575.  
  576.         menuItem
  577.             -label "Poke Faces"
  578.             -annotation (getRunTimeCommandAnnotation("PokePolygon"))
  579.             -image "polyPoke.xpm"
  580.             -command "PokePolygon" 
  581.             -dragDoubleClickCommand "PokePolygonOptions"
  582.             ;
  583.  
  584.         menuItem -optionBox true
  585.             -annotation (getRunTimeCommandAnnotation("PokePolygonOptions"))
  586.             -image "polyPoke.xpm"
  587.             -command "PokePolygonOptions"
  588.             ;
  589.  
  590.         menuItem
  591.             -label "Wedge Faces"
  592.             -annotation (getRunTimeCommandAnnotation("WedgePolygon"))
  593.             -image "polyWedgeFace.xpm" 
  594.             -command "WedgePolygon" 
  595.             -dragDoubleClickCommand "WedgePolygonOptions"
  596.             ;
  597.  
  598.         menuItem -optionBox true
  599.             -annotation (getRunTimeCommandAnnotation("WedgePolygonOptions"))
  600.             -image "polyWedgeFace.xpm"
  601.             -command "WedgePolygonOptions"
  602.             ;
  603.  
  604.         //////////////////////////////////////////////////////////////////////        
  605.         menuItem -divider true;
  606.         
  607.         menuItem
  608.             -label "Merge Vertices"
  609.             -annotation (getRunTimeCommandAnnotation("MergeVertices"))
  610.             -image "polyMergeVertex.xpm"
  611.             -command "MergeVertices"
  612.             -dragMenuCommand "performPolyMergeVertex 2"
  613.             -dragDoubleClickCommand "MergeVerticesOptions"
  614.             ;
  615.  
  616.         menuItem -optionBox true
  617.             -annotation (getRunTimeCommandAnnotation("MergeVerticesOptions"))
  618.             -image "polyMergeVertex.xpm" 
  619.             -command "MergeVerticesOptions" 
  620.             ;
  621.         
  622.         menuItem
  623.             -label "Merge Multiple Edges"
  624.             -annotation (getRunTimeCommandAnnotation("MergeMultipleEdges"))
  625.             -image "polySewEdge.xpm"
  626.             -command "MergeMultipleEdges"
  627.             -dragMenuCommand "performPolySewEdge 2"
  628.             -dragDoubleClickCommand "MergeMultipleEdgesOptions"
  629.             ;
  630.  
  631.         menuItem -optionBox true
  632.             -annotation (getRunTimeCommandAnnotation("MergeMultipleEdgesOptions"))
  633.             -image "polySewEdge.xpm" 
  634.             -command "MergeMultipleEdgesOptions" 
  635.             ;
  636.  
  637.         menuItem
  638.             -label "Merge Edge Tool"
  639.             -annotation (getRunTimeCommandAnnotation("MergeEdgeTool"))
  640.             -image "polyMergeEdge.xpm"
  641.             -command "MergeEdgeTool" 
  642.             -dragDoubleClickCommand "MergeEdgeToolOptions"
  643.             ;
  644.  
  645.         menuItem -optionBox true
  646.             -annotation (getRunTimeCommandAnnotation("MergeEdgeToolOptions"))
  647.             -image "polyMergeEdge.xpm" 
  648.             -command "MergeEdgeToolOptions"
  649.             ;
  650.         
  651.         menuItem
  652.             -label "Split Vertex"
  653.             -annotation (getRunTimeCommandAnnotation("SplitVertex"))
  654.             -image "polySplitVertex.xpm"
  655.             -command "SplitVertex"
  656.             ;
  657.  
  658.         //////////////////////////////////////////////////////////////////////
  659.         menuItem -divider true;
  660.  
  661.         // Flip Triangle Edge
  662.         menuItem
  663.             -label "Flip Triangle Edge"
  664.             -annotation (getRunTimeCommandAnnotation("FlipTriangleEdge"))
  665.             -image "polyFlipEdge.xpm"
  666.             -command "FlipTriangleEdge"
  667.             ;
  668.  
  669.         menuItem
  670.             -label "Collapse"
  671.             -annotation (getRunTimeCommandAnnotation("PolygonCollapse"))
  672.             -image "polyCollapseEdge.xpm"
  673.             -command "PolygonCollapse"
  674.             -dragMenuCommand "performPolyCollapse 1"
  675.             ;
  676.  
  677.         menuItem
  678.             -label "Delete Vertex"
  679.             -annotation (getRunTimeCommandAnnotation("DeleteVertex"))
  680.             -image "polyDelVertex.xpm"
  681.             -command "DeleteVertex"
  682.             ;
  683.         
  684.         menuItem
  685.             -label "Delete Edge"
  686.             -annotation (getRunTimeCommandAnnotation("DeleteEdge"))
  687.             -image "polyDelEdge.xpm"
  688.             -command "DeleteEdge" 
  689.             ;
  690.  
  691.         //////////////////////////////////////////////////////////////////////
  692.         menuItem -divider true;
  693.  
  694.         menuItem
  695.             -label "Duplicate Face"
  696.             -annotation (getRunTimeCommandAnnotation("DuplicateFace"))
  697.             -image "polyDuplicateFacet.xpm"
  698.             -command "DuplicateFace"
  699.             -dragMenuCommand "performPolyChipOff 2 1" 
  700.             -dragDoubleClickCommand "DuplicateFaceOptions"
  701.             ;
  702.  
  703.         menuItem -optionBox true
  704.             -annotation (getRunTimeCommandAnnotation("DuplicateFaceOptions"))
  705.             -image "polyDuplicateFacet.xpm" 
  706.             -command "DuplicateFaceOptions"
  707.             ;
  708.  
  709.         menuItem
  710.             -label "Extract"
  711.             -annotation (getRunTimeCommandAnnotation("ExtractFace"))
  712.             -image "polyChipOff.xpm"
  713.             -command "ExtractFace"
  714.             -dragMenuCommand "performPolyChipOff 2 0"
  715.             -dragDoubleClickCommand "ExtractFaceOptions"
  716.             ;
  717.  
  718.         menuItem -optionBox true
  719.             -annotation (getRunTimeCommandAnnotation("ExtractFaceOptions"))
  720.             -image "polyChipOff.xpm" 
  721.             -command "ExtractFaceOptions"
  722.             ;
  723.         
  724.         menuItem
  725.             -label "Separate"
  726.             -annotation (getRunTimeCommandAnnotation("SeparatePolygon"))
  727.             -image "polySeparate.xpm"
  728.             -command "SeparatePolygon"
  729.             ;
  730.         
  731.         //////////////////////////////////////////////////////////////////////
  732.         menuItem -divider true;
  733.  
  734.         menuItem
  735.             -label "Make Hole Tool"
  736.             -annotation (getRunTimeCommandAnnotation("MakeHoleTool"))
  737.             -image "polyMergeFacet.xpm"
  738.             -command "MakeHoleTool"
  739.             -dragDoubleClickCommand "MakeHoleToolOptions"
  740.             ;
  741.  
  742.         menuItem -optionBox true
  743.             -annotation (getRunTimeCommandAnnotation("MakeHoleToolOptions"))
  744.             -image "polyMergeFacet.xpm" 
  745.             -command "MakeHoleToolOptions"
  746.             ;
  747.  
  748.         menuItem
  749.             -label "Fill Hole"
  750.             -annotation (getRunTimeCommandAnnotation("FillHole"))
  751.             -image "polyCloseBorder.xpm"
  752.             -command "FillHole"
  753.             ;
  754.         
  755.         //////////////////////////////////////////////////////////////////////
  756.  
  757.         // Artisn: Sculpt Polygons Tool.
  758.         menuItem -divider true;
  759.  
  760.         menuItem
  761.             -label "Sculpt Polygons Tool"
  762.             -annotation (getRunTimeCommandAnnotation("SculptPolygonsTool"))
  763.             -image "puttyPoly.xpm"
  764.             -command "SculptPolygonsTool"
  765.             -dragDoubleClickCommand "SculptPolygonsToolOptions"
  766.             ;
  767.  
  768.         menuItem -optionBox true
  769.             -annotation (getRunTimeCommandAnnotation("SculptPolygonsToolOptions"))
  770.             -image "puttyPoly.xpm"
  771.             -command "SculptPolygonsToolOptions"
  772.             ;
  773.  
  774.         //////////////////////////////////////////////////////////////////////
  775.         menuItem -divider true;
  776.  
  777.         // Clipboard submenu
  778.         string $clipboardItem = `menuItem -label "Clipboard Actions"
  779.             -subMenu true -tearOff true
  780.             -allowOptionBoxes true`;
  781.         PolyClipboardMenu $clipboardItem;
  782.         setParent -menu ..;    
  783.  
  784.         // Selection submenu    
  785.         string $selectItem = `menuItem -label "Selection"
  786.             -subMenu true -tearOff true
  787.             -allowOptionBoxes true`;
  788.         PolySelectMenu $selectItem;
  789.         setParent -menu ..;    
  790.  
  791.         menuItem -divider true;
  792.         
  793.         // Color 
  794.         string $colorsItem = `menuItem -label "Colors"
  795.             -subMenu true -tearOff true
  796.             -allowOptionBoxes true
  797.                         -postMenuCommand ("refreshPolyColorsMenu \""+$parent+"\"")`; 
  798.         PolyColorsMenu $colorsItem;
  799.         setParent -menu ..;    
  800.         
  801.         // Normals    
  802.         string $normalsItem = `menuItem -label "Normals"
  803.             -subMenu true -tearOff true
  804.             -allowOptionBoxes true`;
  805.         PolyNormalsMenu $normalsItem;
  806.         setParent -menu ..;
  807.         
  808.         //////////////////////////////////////////////////////////////////////
  809.         menuItem -divider true;
  810.     
  811.         // Move component
  812.         menuItem
  813.             -label "Move Component"
  814.             -annotation (getRunTimeCommandAnnotation("MovePolygonComponent"))
  815.             -image "polyMoveVertex.xpm"
  816.             -command "MovePolygonComponent"
  817.             -dragMenuCommand "performPolyMove \"\" 2"
  818.             -dragDoubleClickCommand "MovePolygonComponentOptions"
  819.             ;
  820.  
  821.         menuItem -optionBox true
  822.             -annotation (getRunTimeCommandAnnotation("MovePolygonComponentOptions"))
  823.             -image "polyMoveVertex.xpm" 
  824.             -command "MovePolygonComponentOptions"
  825.             ;
  826.  
  827.         // Set options
  828.         menuItem -edit -checkBox `optionVar -query polyCreateShaderWithMapping`
  829.             toggleCreateShaderItem;
  830.     }
  831. }
  832.  
  833.